#pragma once

#ifndef _RENDERABLE_SIMPLE_DROPLET
#define _RENDERABLE_SIMPLE_DROPLET

#include <OGLGlobals.h>
#include <OGLIRenderableObject.h>
#include <OGLObjectData.h>
#include <OGLGeometryData.h>

#include <gl/glew.h>
#include <gl/GLU.h>
#include <gl/glfw.h>
#include <glm/glm.hpp>

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>

// Structure to hold vertex position & color data
typedef struct _Vertex_Data
{
	float XYZW[4];
	float RGBA[4];
} VertexData;

// Renders a VERY SIMPLE DROPLET Model by parsing a .txt file with 
// vertex and color information.
class RenderableObject : public OGLIRenderableObject
{
protected :
	VertexData *vertexData;
	bool modelLoaded;

	OGLResult createVBO(GLsizeiptr bufferSize);
	void createVAOPointerData(
		GLuint index, 
		GLuint size, 
		GLenum type, 
		GLboolean normalized,
		GLsizei stride,
		GLvoid *offset);

	OGLResult destroyVOs(void);

public :

	RenderableObject(void);
	RenderableObject(
		OGLDataObject *objectData, 
		OGLGeometryData *geometryData
	);
	virtual ~RenderableObject(void);

	virtual OGLResult LoadModel(std::string filePath);
	virtual OGLResult Render(GLuint activeVAO, GLuint activeProgram);
	virtual OGLResult Cleanup(void);

	void DEBUG_PrintVertexData(void);
};

#endif